﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 职工端
{
    public partial class 清单 : Form
    {
        string constr = denglu.strcon;
        public static string wid;
        DataSet myst = new DataSet();
        SqlDataAdapter myda;
        public 清单()
        {
            InitializeComponent();
            sx();
        }
        void sx()
        {
            SqlConnection sqlcon = new SqlConnection(constr);
            sqlcon.Open();
            string sql = "select Goods.gid as 商品ID,Goods.gname as 商品名称,Goods.gtype as 商品类型,Goods.sprice as 商品进价,Worder.woammount as 购入数量,Supplier.sname as 供货商名称,Supplier.snumber as 联系电话,Supplier.saddress as 地址,Worder.wodate as 清单时间 from Worder,Goods,Supplier where Wid='"+wid+"' and Goods.gid=Worder.gid and Supplier.gid=Worder.gid";
            SqlCommand cmd = new SqlCommand(sql,sqlcon);
            myda = new SqlDataAdapter(cmd);
            myst.Tables.Clear();
            myda.Fill(myst,"B");
            dataGridView1.DataSource = myst.Tables["B"];
            sqlcon.Close();

        }
    }
}
